<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>登录</title>
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>ui/css/login.css">
<script type="text/javascript">
		function checkForm(){
			if(document.getElementById("userName").value == ""){
				document.getElementById("alertDiv").innerHTML ="请输入用户名！";
				document.getElementById("userName").focus();
				return false;
			}
			
			if(document.getElementById("password").value == ""){
				document.getElementById("alertDiv").innerHTML ="请输入密码！";
				document.getElementById("password").focus();
				return false;
			}
			
			return true;
		}
		function login(){
			if(!checkForm()) return;
			var formSeralize=$("#loginForm").serialize();
			var url="${basePath}login/doLogin.html";
			$.post(url,formSeralize,function(data){
				if(data && data.key=="y"){
					<%-- document.location.href="<%=basePath%>user/index.html"; --%>
					document.location.href="${basePath}user/index.html";
				}else{
					document.getElementById("alertDiv").innerHTML ="用户名或密码错误！";
				}
			});
		}
		
	</script>
</head>

<body style="background:#fff" onkeydown="if(event.keyCode==13)  login()">
	<div class="header">
		<div class="header_c">
			<a class="logo pngFix" href=""><img
				src="<%=basePath%>image/login/logo.png" /></a>
		</div>
	</div>

	<div class="container">
		<!--中间部分开始-->
		<div class="middle">
			<!--右边部分开始-->
			<DIV id=login>
				<DIV class=main>
					<DIV id=user class=content>
						<div class="login_title">
							<strong>会员登录</strong>
							<!-- <span>还没有<a href="login/pt/tuser/registPage">注册</a></span> -->
						</div>
						<form method="post" id="loginForm">
							<div id="alertDiv" align="center"
								style="color:red; font-size:14px">${errMsg }</div>
							<table class="t2" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td class=""></td>
									<td style="line-height: 20px;text-align: left;" align="left">
									</td>
								</tr>
								<tr>
									<td class="textname">用户名：</td>
									<td class="edit"><input id="userName" name="userName"
										type="text" maxlength="25" value="" /></td>
								</tr>
								<tr>
									<td class=""></td>
									<td style="line-height: 20px;text-align: left;" colspan="2"
										align="left"></td>
								</tr>
								<tr>
									<td class="textname">密码：</td>
									<td class="edit"><input id="password" name="password"
										type="password" maxlength="25" value="" /></td>
								</tr>
								<tr>
									<td></td>
									<td style="line-height: 20px;text-align: left" colspan="2"
										align="left"></td>
								</tr>

								<tr>
									<td></td>
									<td style="line-height: 20px;text-align: left;" colspan="2"
										align="left"></td>
								</tr>
								<!-- <tr>
								<td class="textname">								</td>
								<td class="edit">
									<input class="chk_rname" type="checkbox" checked="checked" name="remuser" tabindex="4">
									<label for="remuser">
										记住登录状态		</label>								</td>
							</tr>
 -->
								<tr>
									<td colspan="2" align="center"><input type="button"
										value="登录" class="login_btn" id="login_btn" onclick="login()"
										onkeydown="if(event.keyCode==13)  login()" /></td>
								</tr>
							</table>
						</form>
					</DIV>
					<div style="width: 540px;float:left;text-align: center;">
						<img src="<%=basePath%>image/login/ad_19a0dbee.png" />
					</div>
				</DIV>
			</DIV>

		</div>



		<!--尾部-->
		<div class="foot" style="float:left">
			<p>版权所有：九如香餐饮有限公司 Copyright © 2014-2015 XXXXX.com All Rights
				Reserved</p>
			<p>地址：</p>
			<p>电话：</p>
		</div>
	</div>
	<!--友情链接-->



</body>
</html>
